﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// 经理审批
namespace ChainofResponsibilityPattern1
{
    class ManageApprove : AbstractApprover
    {
        public override void handle(personRequest personRequest)
        {
            if ("钓鱼".Equals(personRequest.reason))
            {
                Console.WriteLine("经理拒绝了你的请假");
                return;
            }
            Console.WriteLine($"经理同意了你请{personRequest.days}天假");
            // 下一个处理者
            AbstractApprover next = Next();
            if(next == null)
            {
                return;
            }
            next.handle(personRequest);
        }
    }
}
